<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>实验室项目</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true"  layout="table" tiptype="3" >
		<input id="id" name="id" type="hidden" value="${project.id }">
		<table style="" cellpadding="0" cellspacing="1" class="formtable"> 
					
				<tr>
				<td align="right">
						<label class="Validform_label">
							选择校区:
						</label>
					</td>
					<td class="value">
					    <t:CommonSelect url="expFieldSchoolController.do?select" callback="schoolLoded"
					 			 name="schoolId" textField="schoolName" idField="id"></t:CommonSelect>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">校区名称</label>
					</td>
				</tr>
				 
				<tr>
					<td align="right">
						<label class="Validform_label">
							选择楼号:
						</label>
					</td>
					<td class="value">
					     	<t:CommonSelect url="buildingController.do?select"  callback="buildingLoaded"
					 			 name="buildingId" textField="buildingNumber" idField="id"></t:CommonSelect>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">楼号</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							所属楼层:
						</label>
					</td>
					<td class="value">
					     	 
						 <t:CommonSelect url="floorController.do?select"  
					 			 name="floorId" textField="floorNumber" idField="id"  callback="floorLoaded"></t:CommonSelect>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">所属楼层</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							房间号码:
						</label>
					</td>
					<td class="value">
					     	 
						 <t:CommonSelect url="buildingRoomController.do?select"  datatype="*"
					 			 name="roomId" textField="roomNumber" idField="id"  ></t:CommonSelect>
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">房间号码</label>
					</td>
				</tr>
			</table>
		</t:formvalid>
		<script>
	 
		
		
		
		//根据form表单内容，获取场地对象
		function getfield(){
			var school = $("#schoolId").find("option:selected").text();
			var building = $("#buildingId").find("option:selected").text();
			var floor = $("#floorId").find("option:selected").text();
			var room = $("#roomId").find("option:selected").text();
		  
			if($('#roomId').val() == null){
				tip('请选择房间号码！');
				return null;
			}
		
			var staff = {
					school:school,
					building:building,
					id:$('#roomId').val(),
					floor:floor,
					room:room
			}
		
			return staff;
		}
		
 
		 $('#schoolId').change(function(){
		 		schoolLoded();
		 	 
		 });
			
		 //校区下拉框加载完毕
		function schoolLoded(){
			var schoolId = $('#schoolId').val();
		 	//重新刷新建筑id
		 	buildingIdselect("&schoolId="+schoolId);
		}
			
		//楼号重新加载
		 function buildingLoaded(){
		 	var buildingId = $('#buildingId').val();
		 	//重新刷新楼层
		 	floorIdselect("&buildId="+buildingId);
		 }
		
		 	$('#buildingId').change(function(){
		 		buildingLoaded();
		 	});
		 	 
		 	$('#floorId').change(function(){
		 		floorLoaded();
		 	});
		 	
		 	//楼层加载完毕
		 	function floorLoaded(){
		 		var id = $('#floorId').val();
		 		//重新刷新建筑id
		 		roomIdselect("&floorId="+id);
		 	}
	 
		</script>
 </body>
 